# Generated manually for hazard tracking system

from django.db import migrations, models
import django.utils.timezone


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='HazardTracking',
            fields=[
                ('task_id', models.CharField(help_text='系统唯一编号，如 HX20251009-001', max_length=50, primary_key=True, serialize=False, unique=True, verbose_name='任务编号')),
                ('mine_name', models.CharField(help_text='所属矿山名称', max_length=200, verbose_name='矿山名称')),
                ('indicator_name', models.CharField(help_text='触发整改的具体指标，如"支护设备完好率"', max_length=200, verbose_name='指标名称')),
                ('safety_level', models.CharField(choices=[('C级(一般)', 'C级(一般)'), ('D级(较差)', 'D级(较差)')], help_text='危险等级', max_length=20, verbose_name='安全等级')),
                ('trigger_condition', models.CharField(help_text='指标触发整改的条件，如"完好率 < 0.6"', max_length=500, verbose_name='触发条件')),
                ('remediation_suggestion', models.TextField(help_text='对应模板生成的整改内容', verbose_name='整改建议')),
                ('responsible_person', models.CharField(help_text='执行整改的人员姓名或岗位', max_length=100, verbose_name='责任人')),
                ('status', models.CharField(choices=[('待整改', '待整改'), ('整改中', '整改中'), ('整改完成', '整改完成'), ('复核通过', '复核通过')], default='待整改', help_text='任务状态', max_length=20, verbose_name='整改状态')),
                ('assigned_date', models.DateTimeField(auto_now_add=True, help_text='系统生成任务的时间', verbose_name='指派日期')),
                ('deadline_date', models.DateTimeField(help_text='规定整改完成时间', verbose_name='截止日期')),
                ('completion_date', models.DateTimeField(blank=True, help_text='实际完成整改时间', null=True, verbose_name='完成日期')),
                ('attachments', models.JSONField(blank=True, default=list, help_text='上传的整改材料（照片、报告等）', verbose_name='附件')),
                ('reviewer', models.CharField(blank=True, help_text='复核人员姓名', max_length=100, verbose_name='复核人')),
                ('review_comment', models.TextField(blank=True, help_text='复核结果或意见', verbose_name='复核意见')),
                ('remarks', models.TextField(blank=True, help_text='其他说明', verbose_name='备注')),
                ('evaluation_id', models.IntegerField(blank=True, help_text='关联的安全评价记录ID', null=True, verbose_name='关联评价记录ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
            ],
            options={
                'verbose_name': '隐患追踪',
                'verbose_name_plural': '隐患追踪',
                'db_table': 'hazard_tracking',
                'ordering': ['-assigned_date'],
            },
        ),
    ]

